﻿@{
    ViewBag.Title = "Online Event Viewer - Dashboard";
    ViewBag.Breadcrumb = "Dashboard";
}

<h2>@ViewBag.Title</h2>
<fieldset>
    <legend><h3>Latest logs</h3></legend>
    <p id="latest-logs-placeholder">
        <img src="@Url.Content("~/Content/Images/ajax-loader.gif")" alt="Loading" />
    </p>
</fieldset>
<fieldset>
    <legend><h3>Logs with events by level</h3></legend>
    <p id="levels-placeholder">
        <img src="@Url.Content("~/Content/Images/ajax-loader.gif")" alt="Loading" />
    </p>
</fieldset>
<fieldset>
    <legend><h3>Latest events</h3></legend>
    <p id="latest-events-placeholder">        
        Importing and loading requested data.
        <br />
        Because the data imports asynchronously you won't see results immediately if it is the first time access.
        <br />
        Refresh at a later time to view the actual results.
        <br />
        <img src="@Url.Content("~/Content/Images/ajax-loader.gif")" alt="Loading" /><img src="@Url.Content("~/Content/Images/import.png")" alt="Loading" />
    </p>
</fieldset>

@section Foot{
<script type="text/javascript">
    $(document).ready(function () {
        $('#levels-placeholder').load('@(Url.Action("ListLevels","Log"))');
        $('#latest-logs-placeholder').load('@(Url.Action("List", "Log"))');
        $('#latest-events-placeholder').load('@(Url.Action("List", "Event"))');       
    });
</script>
}